JBoss Community Archive (Read Only)

Mobicents

Using the Generator

Currently, there are two ways to use the MIB Generator. The first is to simply use the executable jar, with the desired files, to output an MIB of your choosing. The second is to use the maven plugin that will invoke the MIB Generator on given files at compile time, allowing you to have an MIB for your web application which is designed to run on the JBossAS.

Using the JAR

The jar has a very simple set of commands. They are as follows:

  • -a : The attributes file to be used, if any.

  • -n : The notifications file to be used, if any.

  • -m : The Module Name to be used. This Module Name is how the SNMP manager will identify the definitions in the MIB, it is not done by filename.

  • -o : The output file name.

The JAR can be used with both attributes / notifications files, or just the attributes file. It is also possible to use it with just the notifications file, but the tags in such a notifications file must not include a:* tags. It must only contain tags for attributes whose definitions can be generated, such as n:* and u:* tags. The -m and -o flags are required. The -o can include the path you would like to put the final MIB.

Example usage:

[thauser@tommycat snmp-adaptor.sar]$ java -jar jboss-snmp-5.1.1.GA-mib-generator.jar -a attributes.xml -n notifications.xml -m JBOSS-AS-VARIA -o ~/.snmp/mibs/TEST.mib

Using the Maven Plugin

There is also a Maven Plugin available. Instead of specifying these files on the command line, they are included in the plugin descriptor inside your project's pom.xml. Here's an example of such a descriptor:

<plugin>
 <groupId>org.jboss</groupId>
 <artifactId>mibgen-maven-plugin</artifactId>
 <version>1.0-SNAPSHOT</version>
  <configuration>
   <attributesFile>workspace/snmp4j-int/varia/src/resources/services/snmp/deploy/attributes.xml</attributesFile>
   <notificationsFile>workspace/snmp4j-int/varia/src/resources/services/snmp/deploy/notifications.xml</notificationsFile>
   <moduleName>TEST-MIB</moduleName>
   <outputFile>/home/yyz/thauser/.snmp/mibs/JBOSS-AS-VARIA.mib</outputFile>
  </configuration>
 <executions>
  <execution>
   <phase>compile</phase>
    <goals>
     <goal>generate-mib</goal>
    </goals>
   </execution>
 </executions>
</plugin>
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 11:41:59 UTC, last content change 2011-07-20 14:26:39 UTC.